package com.runmi.webchat.aftersale.dbcore.dao;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.runmi.webchat.aftersale.dbcore.entity.SetupItem;
import com.runmi.webchat.aftersale.dbcore.mapper.SetupItemMapper;

@Repository
public class SetupItemDao {

	@Autowired
	private SetupItemMapper setupItemMapper;
	
	public List<SetupItem> getSetupItemList(Integer shopId){
		SetupItem record=new SetupItem();
		record.setDelFlag((byte)0);
		record.setStatus((byte)1);
		record.setShopId(shopId);
		return setupItemMapper.select(record);
	}
	
	public SetupItem getItemByShopAndItemCode(Integer shopId,String itemCode){
		SetupItem record=new SetupItem();
		record.setDelFlag((byte)0);	
		record.setShopId(shopId);
		record.setItemCode(itemCode);
		List<SetupItem> items= setupItemMapper.select(record);
		if(null!=items && items.size()>0){
			return items.get(0);
		}else{
			return null;
		}
	}
}
